/**
 * huize Service Inc
 * All Rights Reserved @2018
 */
package com.huize.ladon.apm.common.util;

import org.apache.commons.codec.digest.DigestUtils;

/**
 * 描述: MD5加密工具类
 *
 * @author tianyuliang
 * @version $Id: MD5Utils.java, v0.1 2019/7/24
 */
public class MD5Utils {

    /**
     * MD5加密
     *
     * @param param
     * @return
     */
    public static final String build(String param) {
        return DigestUtils.md5Hex(param).toUpperCase();
    }

    /**
     * test case
     *
     * @param args
     */
    public static void main(String[] args) {
        String param = "0a09021b15639192000780c0e1013";
        System.out.println("param=" + param + ", md5=" + build(param));

        param = "f251c848c6c649b4b8d4b0579b0329ba";
        System.out.println("param=" + param + ", md5=" + build(param));


        param = "0a09021b15639192000780c0e1013f251c848c6c649b4b8d4b0579b0329ba";
        System.out.println("param=" + param + ", md5=" + build(param));

        param = "0a09021b15639192000780c0e1013|f251c848c6c649b4b8d4b0579b0329ba";
        System.out.println("param=" + param + ", md5=" + build(param));

        param = "0a09021b15639192000780c0e1013-f251c848c6c649b4b8d4b0579b0329ba";
        System.out.println("param=" + param + ", md5=" + build(param));
    }
}


